package com.mud.mudcommune.view.fragment.twoLevel;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.mud.mudcommune.R;
import com.mud.mudcommune.adapter.ProcessAdapter;
import com.mud.mudcommune.entry.ProcessEntry;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * A simple {@link Fragment} subclass.
 */
public class ProblemFragment extends Fragment {
    private static Fragment fragment = new ProblemFragment();
    @BindView(R.id.process_list)
    ListView listView;
    private List<ProcessEntry> list;
    private ProcessAdapter adapter;
    public static Fragment getInstance() {
        return fragment;
    }
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.process, container, false);
        ButterKnife.bind(this,view);
        initData();
        return view;
    }

    private void initData() {
        list=new ArrayList<>();
        ProcessEntry entry1=new ProcessEntry("免费预约报价","一键预约,工长上门量房报价");
        ProcessEntry entry2=new ProcessEntry("线上签约","签约合约，支付99元开工款");
        ProcessEntry entry3=new ProcessEntry("开工","开工交底，运营完成99项质检，预收水电款（合同款40%）");
        ProcessEntry entry4=new ProcessEntry("水电施工","工长施工，监理完成10项质检，预收水电款（合同款40%）");
        ProcessEntry entry5=new ProcessEntry("泥木施工","工长施工，监理完成14项质检，预收油漆款（合同款40%）");
        ProcessEntry entry6=new ProcessEntry("油漆施工","工长施工，运营完成9项质检");
        ProcessEntry entry7=new ProcessEntry("竣工阶段","工长施工，运营完成10项质检，施工完毕");

        list.add(entry1);
        list.add(entry2);
        list.add(entry3);
        list.add(entry4);
        list.add(entry5);
        list.add(entry6);
        list.add(entry7);
        adapter=new ProcessAdapter(getContext(),list);
        listView.setAdapter(adapter);
    }
}
